import { defineStore } from 'pinia'
import { ref } from 'vue'
import { addressOptions } from '@/data/addressData'

export const addressStore = defineStore('address', () => {
  const options = ref(addressOptions)
  const address1 = ref('361000')
  const address2 = ref('363000')

  // 交换
  const change = () => {
    const temp = address1.value
    address1.value = address2.value
    address2.value = temp
  }

  return {
    options,
    address1,
    address2,
    change,
  }
})
